/*
 * Copyright 2009, 2010, YUNNAN Co-soft Information Technology Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.cs.website.client;

import com.cs.web.client.AbstractClientModule;
import com.cs.website.client.action.impl.IndexAction;
import com.cs.website.client.captcha.CaptchaServlet;
import com.google.inject.Scopes;

/**
 * Client-side module for <a href="http://code.google.com/p/google-guice/">
 * Guice</a> configurations.
 *
 * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
 * @version 1.0.0.6, Jun 25, 2010
 */
final public class ClientModule extends AbstractClientModule {

    /**
     * Using the {@linkplain AbstractClientModule#configureServlets()
     * superclass' configurations} and appends others.
     *
     * Servlets:
     * <ul>
     *   <li>{@link IndexAction}</li>
     *   <li>{@link CaptchaServlet}</li>
     * </ul>
     */
    @Override
    protected void configureServlets() {
        super.configureServlets();
       
        // servlets
        bind(IndexAction.class).in(Scopes.SINGLETON);
        serve("/index.do").with(IndexAction.class);

        bind(CaptchaServlet.class).in(Scopes.SINGLETON);
        serve("/captcha.do").with(CaptchaServlet.class);

    }
}
